<template>
  <div class="block">
    <span class="demonstration">Click 指示器触发</span>
    <el-carousel trigger="click" height="150px">
      <el-carousel-item v-for="item in 4" :key="item">
        <h3 class="small">{{ item }}</h3>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  name: "index",
  // 对象
  props: {
    propA: {
      type: String, //传入值限定类型
      // type 值可为String,Number,Boolean,Array,Object,Date,Function,Symbol
      // type 还可以是一个自定义的构造函数，并且通过 instanceof 来进行检查确认
      required: true, //是否必传
      default: 200, //默认值,对象或数组默认值必须从一个工厂函数获取如 default:()=>[]
      validator(value) {
        // 这个值必须匹配下列字符串中的一个
      }
    }
  },

  data() {
    return {
      name: ""
    };
  },
  watch: {},
  mounted() {
    this.function();
  },
  methods: {
    function() {}
  }
};
</script>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
